Digital images are typically captured by a charge coupled device (CCD) and processed by a DSP or a computer processing unit (CPU) to be displayed by a display device. A CCD digitizes light which falls upon its sensors located within a digital image capture device, such as a digital camera. The data from the sensors are typically converted into a first data format, such as the Red-Green-Blue (RGB) format with numerous RGB pixels per image. This RGB data is then often converted to another color space, such as YCC (luminance, chrominance-blue, chrominance-red), to be displayed. However, the conversion from the first data format to the second data format is very costly in terms of CPU time.
FIG. 1A is a flow chart illustrating a conventional method of converting an image in a first data format to a second data format. In this example, the first data format is the RGB format while the second data format is the YCC format. First, the image is received through the CCD in RGB data format, via step 10. Then the white balance correction is performed on the image to correct the representation of colors so that white areas appear white, via step 20. White balancing correction involves three multiplications per RGB pixel, one for red, one for green, and one for blue. The resulting RGB value from these multiplications is then clipped, via step 30, so that it is no larger than the maximum value allowed for the image process, for example 255 for 8 bit values. The maximum value is determined by the set-up of the image process.
Next, color correction is performed, via step 40. The color correction changes the white balanced RGB image so that its colors are more consistent with standard colors. Color correction involves the multiplication of a 3.times.3 matrix with the RGB pixel data, or nine multiplications per RGB pixel. The value of the white balanced and color corrected image is again clipped, via step 50 so that it does not exceed the maximum value allowed for this image process.
Next, gamma correction is performed on the image, via step 60, to correct any nonlinearity. The gamma correction converts nonlinear data to linear data by applying a nonlinear vector. This is done by generating and applying a look-up table (LUT) of conversion values for the particular image.
Next, a color space conversion is performed, via step 70, to convert the corrected and balanced image to the appropriate format for display. In this case, the format for display is YCC. This involves a the multiplication of a 3.times.3 matrix to the RGB pixel data, or nine multiplications per RGB pixel. The resulting YCC value is then clipped, via step 80. Finally, the image in YCC format is displayed to a display device, such as an LCD screen, via step 90.
FIG. 1B illustrates an example of the conversion from RGB format to YCC format under a convention method. For this example, assume an image in RGB format is represented by three matrices, [r] (red values), [g] (green values), and [b] (blue values). These three matrices are collectively referred to as Z. Also assume that B in FIG. 1B is the color correction matrix, and C is the color space correction matrix. Under the conventional method, first white balance values, WBr, WBg, and WBb, are multiplied with Z, resulting in matrix A (step 20). The values are clipped (step 30). Next, color correction matrix B is multiplied with A, resulting in matrix D (step 40). The values are clipped again (step 50). Then the gamma correction is performed on matrix D by applying the gamma correction LUT, resulting in matrix E. (Step 60) Typical gamma correction LUTs are quite large and in the interest of space, it will not be reproduced here. However, they are well known in the art. Color space conversion is then performed on matrix E by multiplying it with matrix C, resulting in matrix F (step 70). The values are clipped (step 80), resulting in matrix F. Steps 20 through 80 are performed for every RGB pixel value in the image. The image represented by matrices F for each pixel is in YCC format for display on an LCD screen (Step 90).
The problem with the above conventional method of converting an image from the first data format to the second data format is the high cost in CPU time. The multiplications in particular are costly and limits the number of frames which can be displayed within a certain amount of time. Where data in RGB format is converted to YCC format, the conventional method requires twenty-one multiplications per pixel, as well as one LUT and three clippings.
Thus, there exists a need for a method of converting an image from a first data format to a second data format which require less CPU time but does not significantly diminish the quality of the image displayed. The present invention addresses such a need.